<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>003-storage.html</title>
</head>
<body>
	
</body>
<script>
	// console.log(localStorage);
	// console.log(sessionStorage);
	// setItem(key,value)//设置
	// localStorage.setItem('username','Chris');
	// localStorage.setItem('age','24');
	// localStorage.setItem('xx','qq');
	//get item (key)获取
	// console.log(localStorage.getItem('username'));
	//removeitem(key)删除
	// localStorage.removeItem('aa');
	//clear()清除所有
	//localStorage.clear();
	//length 内容个数
	// console.log(localStorage.length);
	//key(num)获取key的值
	// console.log(localStorage.key(0));





	// setItem(key,value)//设置
	// sessionStorage.setItem('username','Chris');
	// sessionStorage.setItem('age','24');
	// sessionStorage.setItem('xx','qq');
	//get item (key)获取
	// console.log(sessionStorage.getItem('username'));
	//removeitem(key)删除
	// sessionStorage.removeItem('aa');
	//clear()清除所有
	// sessionStorage.clear();
	//length 内容个数
	// console.log(sessionStorage.length);
	//key(num)获取key的值
	console.log(sessionStorage.key(0));
</script>
</html>